//
//  UnderlineTextField.swift
//  YUANSHI
//
//  Created by pro on 2020/1/8.
//  Copyright © 2020 wangbin. All rights reserved.
//

import UIKit

class UnderlineTextField: UITextField {

    
    override func draw(_ rect: CGRect) {
        //获取当前上下文
        guard let context = UIGraphicsGetCurrentContext() else { return }
        context.setFillColor(UIColor.black.cgColor)
        context.fill(CGRect(x: 0, y: self.frame.height - 0.5, width: self.frame.width, height: 0.5))
        UIGraphicsBeginImageContextWithOptions(rect.size, true, 0)
    }

}


